const express = require('express')
const router = express.Router()
const expressJoi = require('@escook/express-joi')
const { updata_userInfo_schema, update_userInfo_pwd, updata_userInfo_PIC} = require('../schema/user')
// 导入路由模块 处理函数
const userinfo_handler = require('../router_handler/userinfo')
// 获取用户信息模块
router.get('/userinfo',  userinfo_handler.getUserInfo)

// 更新用户的基本数据
router.post('/userinfo', expressJoi(updata_userInfo_schema), userinfo_handler.updateUserInfo)

// 重置密码
router.post('/updatePWD', expressJoi(update_userInfo_pwd), userinfo_handler.updatePWD)

// 更新用户头像 
router.post('/update/avatar',expressJoi(updata_userInfo_PIC), userinfo_handler.updatePIC)

module.exports = router